package com.sskj.uboex.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.uboex.bean.AssetBean;
import com.sskj.uboex.http.HttpConfig;
import com.sskj.uboex.ui.fragment.FinanceFragment;

import java.util.List;


public class FinanceFragmentPresenter extends BasePresenter<FinanceFragment> {
    /**
     * 获取资产列表
     *
     * @return
     */
    public void getAssets() {
        httpService.getAssets()
                .execute(new JsonCallBack<HttpData<List<AssetBean>>>() {
                    @Override
                    public void onSuccess(Response<HttpData<List<AssetBean>>> response) {
                        HttpData<List<AssetBean>> httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {

                            mView.updateUI(httpData.getData().get(0));
                        }
                    }
                });
    }
}
